package ch06.ith_2;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Scanner;


public class ex01 {
    public static void main(String[] args) throws ParseException {
StringToDate();
    }
    static void StringToDate() throws ParseException  {
        Scanner sc = new Scanner(System.in);
        DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String birth = sc.nextLine();//我的出生日期
        Date date = df.parse(birth);//转换
        Date dangqian = new Date();//当前日期
        System.out.println(date);
        System.out.println(dangqian);
//计算差值，天数long days=(date2.getTime()-date1.getTime())/(1000*60*60*24);
        System.out.println("你出生"+(dangqian.getTime()-date.getTime())/(1000*60*60*24)+"天了");


    }

}
